package com.action;


import com.service.DepService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;

import java.util.List;

@Controller
public class DepAction {

    @Autowired
    private DepService  depService;

    @RequestMapping("/showDep")
    public String showDep(Model m)
    {
        List list = depService.list();
        m.addAttribute("list",list);
        m.addAttribute("age",18);
        return "showDep";  //showDep.html
    }

}
